#include<iostream>
using namespace std;

char *transpose(char *str);

int main()
{
    char str[100];
    cout << "请输入字符串：";
    cin >> str;
    cout << transpose(str) << endl;

    return 0;
}
char *transpose(char *str)
{
    if(str == NULL)
        return str;

    char *begin = str;
    char *end = str;

    while(*end != '\0')
        end++;
    //将最后一个\0符号往前挪一个
    end--;
    char t;
    while(begin < end)
    {
        t = *begin;
        *begin = *end;
        *end = t;
        begin++;
        end--; 
    }
    
    return str;
}
